<?php
$this->Html->addCrumb('Wedding Basics & Tips');
?>

<h1 class="pageTitle">Wedding Basics & Tips</h1>


<?php
  if (isset($articles) && !empty($articles)) {
    foreach ($articles as $article) {
      $created = new DateTime($article['Article']['created']);
      echo '<div class="article">';
      echo '<h1>'.$article['Article']['title'].'</h1>' ;
      if (!empty($article['Article']['image_path'])) {
        echo '<img src="'.Configure::read('App.pathPrefix').'/'.IMAGES_URL.$article['Article']['image_path'].'"  alt="'.$article['Article']['title'].'" class="right" />';
      }
      echo '<p>'.nl2br($article['Article']['body']).'</p>' ;
      echo "<p class='articleTimestamp'>Posted ".$created->format('m/d/Y g:i:s a')."</p>";
      echo '</div>';
    }
    echo $this->element('main_pagination');
  } else {
    echo '<p>No articles are currently available.</p>';
  }
?>